﻿using System;
using System.Collections.Generic;

using SharedGenomics.Core;

namespace SharedGenomics.Workbench.Core
{
    public class BuildUpPresenterInitialisationStage : PresenterInitialisationStage
    {
        public override bool Initialise(IPresenterInitialisationContext context)
        {
            context.ThrowIfNull("context");
            context.Container.ThrowIfNull<ArgumentException>("Container not set in context");

            if (context.Current != null)
            {
                context.Container.BuildUp(context.PresenterType, context.Current);
            }

            return true;
        }
    }
}
